Repository navigation
fix(geo): keep a wkt-named attribute from taking over the csv geometry - #1208
Merged
Merged
Conversation
A point dataset with a WKT-named attribute could be written so that the attribute replaced the real geometry when Filee read its own CSV. Names normalized to wktgeo could also leave the generated header unrecognized after a collision. Write these datasets with WKT and give the generated header the reader's highest-priority normalized name when needed. Collision suffixes preserve that name, so WKT-like attributes round-trip without changing third-party read precedence.
KnifeLemon
approved these changes
Nov 6, 2026
KnifeLemon
left a comment
Owner
There was a problem hiding this comment.
Thanks, @mertkayacs! A good catch: a wkt-named attribute could take over the geometry on the way back. Writing WKT in that case, with the generated column taking the reader's first name, round-trips each case in the tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Converting points to CSV wrote
longitudeandlatitudecolumns even when an attribute already had a WKT column name, such aswkt,geometry,the_geomorshape. Reading that CSV back took the attribute as the geometry, so a point at (1, 2) withshape = "POINT (9 9)"came back at (9, 9), andshape = "round"made the read fail with "not valid WKT".The writer now uses a WKT geometry column in that case, as it already does for
longitudeandlatitudeattributes. When an attribute is calledwkt_geoor a variant likeWKT-GEO, the generated column takes the same normalized name, and because it is the first column the reader still picks it. Reading CSVs from other tools works as before.Type of change
How was it tested?
dotnet format --verify-no-changesdotnet testNew tests in
GeoFormatTests: a GeoJSON to CSV to GeoJSON round trip for attributes namedshape,wkt,geometry,wkt_geo,WKT-GEOandWKT GEO, one withwktandwkt_geotogether, and one that checks a CSV withshapebeforewktstill readswktas the geometry. The round-trip tests fail onmainand pass with this change.On Linux, the
GeoFormatTestsfilter passes (81),Filee.Cli.Testspasses (85), and the wholeFilee.Engines.Testsproject has 2,467 passed and 14 failed. Those 14 also fail onmainhere, since this machine doesn't have the Pandoc, FFmpeg and fonts that CI fetches. I didn't run the App and Setup suites, which CI runs on Windows. The Release build has the same 19 warnings asmain.Screenshots (UI changes)
None, no UI change.
Checklist
src/Filee.App/Assets/i18n/*.jsonfiles (no new strings)THIRD-PARTY-NOTICES.md(none added)